﻿using System;
using System.Text;
using System.Drawing;
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;

public static partial class glDRIVE
{
    /*
    正态分布函数
    a：a数学期望值。
    d：dd*d为方差值。要求d>0。
    x：x随机变量值。
    函数返回正态分布函数值。
    */

    public static string drive_gass()
    {
        int i, j;
        double a0, d0, x, y;
        double[] a = new double[2] { -1.0, 3.0 };
        double[] d = new double[2] { 0.5, 15.0 };
        StringBuilder sb = new StringBuilder();
        for (i = 0; i <= 1; i++)
        {
            a0 = a[i]; d0 = d[i]; x = -10.0;
            for (j = 0; j <= 4; j++)
            {
                y = gl.gass(a0, d0, x);
                sb.AppendLine("P(" + a0 + ", " + d0 + ", " + x + ")=" + y + "<br>");
                x = x + 5.0;
            }
        }
        return sb.ToString();
    }
}